@(files: List[gitbucket.core.service.RepositorySearchService.FileSearchResult],
  issueCount: Int,
  query: String,
  page: Int,
  repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@import gitbucket.core.service.RepositorySearchService._
@html.main("Search Results", Some(repository)){
  @menu("code", files.size, issueCount, query, repository){
    @if(files.isEmpty){
      <h4>We couldn't find any code matching '@query'</h4>
    } else {
      <h4>We've found @files.size code @plural(files.size, "result")</h4>
    }
    @files.drop((page - 1) * CodeLimit).take(CodeLimit).map { file =>
      <div>
        <h5><a href="@url(repository)/blob/@repository.repository.defaultBranch/@file.path">@file.path</a></h5>
        <div class="small muted">Last committed @helper.html.datetimeago(file.lastModified)</div>
        <pre class="prettyprint linenums:@file.highlightLineNumber" style="padding-left: 25px;">@Html(file.highlightText)</pre>
      </div>
    }
    @helper.html.paginator(page, files.size, CodeLimit, 10,
      s"${url(repository)}/search?q=${urlEncode(query)}&type=code")
  }
}